package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.OpinionMapper;
import com.education.wisdom.pojo.Opinion;
import com.education.wisdom.service.IOpinionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 意见反馈 服务层实现
 * 
 * @author ruoyi
 * @date 2019-03-29
 */
@Service
public class OpinionServiceImpl implements IOpinionService
{
	@Autowired
	private OpinionMapper opinionMapper;

	/**
     * 查询意见反馈信息
     * 
     * @param id 意见反馈ID
     * @return 意见反馈信息
     */
    @Override
	public Opinion selectOpinionById(Integer id)
	{
	    return opinionMapper.selectOpinionById(id);
	}
	
	/**
     * 查询意见反馈列表
     * 
     * @param opinion 意见反馈信息
     * @return 意见反馈集合
     */
	@Override
	public List<Opinion> selectOpinionList(Opinion opinion)
	{
	    return opinionMapper.selectOpinionList(opinion);
	}
	
    /**
     * 新增意见反馈
     * 
     * @param opinion 意见反馈信息
     * @return 结果
     */
	@Override
	public int insertOpinion(Opinion opinion)
	{
	    return opinionMapper.insertOpinion(opinion);
	}
	
	/**
     * 修改意见反馈
     * 
     * @param opinion 意见反馈信息
     * @return 结果
     */
	@Override
	public int updateOpinion(Opinion opinion)
	{
	    return opinionMapper.updateOpinion(opinion);
	}

	/**
     * 删除意见反馈对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteOpinionByIds(String ids)
	{
		return opinionMapper.deleteOpinionByIds(Convert.toStrArray(ids));
	}

	@Override
	public List<Opinion> selectOpinionByUserId(String userId) {
		return opinionMapper.selectOpinionByUserId(userId);
	}
	
}
